{{/*
  Copyright 2011 Google Inc. All Rights Reserved.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/}}

{{template "_top.html" "People.Search"}}
{{template "_header.html" .user}}

<div id="main">
  <section id="introduction">
    <h1>People.Search</h1>
    <p>
      You can look for all public Google+ profiles that match a certain keyword:
      <code>
        people, err := p.People.Search("Larry").Do()
      </code>
    </p>
    <p>
      Again, the user doesn't have to authorize your application to search for
      people. Your app simply specifies the query and your API key.
    </p>
  </section>

  <div class="example">
    <h2>Example</h2>
    <header>
      <form method="GET" action="">
        <input type="text" name="query" value="{{.query | html}}" placeholder="e.g. Chuck Testa" />
        <input type="submit" value="Search" />
      </form>
    </header>

    {{if .query}}
      {{if .people}}
        <ul class="people">
          {{range .people}}
          <li class="person">
            <h1 class="name"><a href="{{.Url | html}}">{{.DisplayName | html}}</a></h1>
            <img src="{{.Image.Url | html}}" width="50" height="50" alt="{{.DisplayName | html}}'s Profile Image" title="{{.DisplayName | html}}"/>
          </li>
          {{end}}
        </ul>
      {{else}}
        <p>Couldn't find anyone matching <q>{{.query | html}}</q>.</p>
      {{end}}
    {{else}}
      <p>Enter a query to find people.</p>
    {{end}}
  </div>
</div>

{{template "_bottom.html"}}

